package com.qczl.pme.entity;

import java.io.Serializable;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * 会议主题类型表
 * 
 * @author SongR
 *
 */
@Entity
@Table(name = "pme_metting_topic")
public class PMETopic implements Serializable {
	private static final long serialVersionUID = -6080331610052487350L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "topic_id")
	private Long id;// 编号
	@Column(name = "topic_pid")
	private Long pid;// 父编号
	@Column(name = "topic_name")
	private String name;// 名称
	@Column(name = "topic_desc")
	private String desc;// 描述
	@Column(name = "topic_status")
	private Integer status;// 状态（-1、已删除0、可用1、不可用）
	@Column(name = "topic_sort")
	private Long sort;// 排序
	@Column(name = "topic_user_id")
	private Long userid;// 创建者
	
	@OneToMany(mappedBy = "topic", cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private Set<PMEMetting> mettings;
	
	@ManyToOne(cascade = CascadeType.ALL,fetch=FetchType.EAGER)
	@JoinColumn(name = "stb_id", referencedColumnName = "stb_id",nullable=false)
	private PMESTB stb;
	
	
	public PMESTB getStb() {
		return stb;
	}

	public void setStb(PMESTB stb) {
		this.stb = stb;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Long getPid() {
		return pid;
	}

	public void setPid(Long pid) {
		this.pid = pid;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getDesc() {
		return desc;
	}

	public void setDesc(String desc) {
		this.desc = desc;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Long getSort() {
		return sort;
	}

	public void setSort(Long sort) {
		this.sort = sort;
	}

	public Long getUserid() {
		return userid;
	}

	public void setUserid(Long userid) {
		this.userid = userid;
	}

}
